unit UJornada;

interface

uses UUtil, SysUtils;

type
  t_jornada = record
    codigo: string;
    hora_inicial: TDateTime;
    hora_final: TDateTime;
  end;
  t_jornadas = array of t_jornada;

procedure obterJornadas(var jornadas: t_jornadas);

implementation

procedure obterJornadas(var jornadas: t_jornadas);
var
  i: integer;
  sql: string;
  tblJornada: sltTabela;
begin
  conectar;
  sql := '';
  sql := sql + 'select * from jornada';
  tblJornada := dtbCF.GetTable(sql);
  SetLength(jornadas, tblJornada.RowCount);
  i := -1;
  while not tblJornada.EOF do
  begin
    inc(i);
    jornadas[i].codigo := tblJornada.Fields[0];
    jornadas[i].hora_inicial := StrToDateTime(tblJornada.Fields[1]);
    jornadas[i].hora_final := StrToDateTime(tblJornada.Fields[2]);
    tblJornada.Next;
  end;
  desconectar;
end;



end.

